let data = {
    socre:0,
    max:0,
    loads:[
        [0,0,0,0],
        [0,0,0,0],
        [0,0,0,0],
        [0,0,0,0]
    ]
}
const data2048 = (state=data,action)=>{

    if(action.type === 'left'){
        let newState = JSON.stringify(JSON.stringify(state))
        console.time('left')
        for(let row=0;i<4;i++){
            for(let right = 3;i>0;i++){
                let left = right -1;
                let rightVal = state.loads[row][right]
                let leftVal = state.loads[row][left]
                let newVal = leftVal
                if(state.loads[row][right] == 0){
                    continue
                }
                if(left == 0 ){
                    state.loads[row][left] == rightVal
                    state.loads[row][right] == 0
                }
            }
        }
        console.timeEnd('left')
    }

    // switch(action.type){
    //     case 'ADD':
    //         return [
    //             ...state,
    //             {
    //                 id:action.id,
    //                 text:action.text,
    //                 completed: false
    //             }
    //         ]
    //     case 'TOGGLE':
    //         return state.map(data =>(data.id == action.id)?{...data,completed:!data.completed}:data);
    //     default:
    //         return state;
    // }
}
export default  datas;